
<%@page import="java.math.MathContext"%><html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title>Assessment</title>
    </head>
    <body>
    <g:render template="/shared/navigation" />
    
    <div id="body">
    
    <h1>Submit Result</h1>

    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>

    <h3>Thank You</h3>
    <p>
    Thank you for taking our online test.
    </p>
    <br/>
    <p>
    Your result is : ${(assignmentInstance?.items?.size() > 0 ? ((assignmentInstance?.total?.asType(int) / assignmentInstance?.items?.size()) * 100) : 0).round(new java.math.MathContext(4))}%
    </p>
    <br/>
    
    
        <div class="list">
        <table>
            <col width="50" />
            <col />
            <col width="150" />
            <thead>
                <tr>
                    <th title="Id">#</th>
                    <th title="Id">Category</th>
                    <th title="Id">Total</th>
                </tr>
            </thead>
            <tbody>
            <g:each in="${assigmentCategoryPoint}" status="i" var="assigmentCategoryPointInstance">
                <tr>
                    <td>${i+1}</td>
                    <td>${assigmentCategoryPointInstance.key}</td>
                    <td align="center"><strong>${assigmentCategoryPointInstance.value.total} of ${assigmentCategoryPointInstance.value.of} (${((assigmentCategoryPointInstance.value.total / assigmentCategoryPointInstance.value.of) * 100).round(new java.math.MathContext(4))}%)</strong></td>
                </tr>
            </g:each>
            </tbody>
        </table>
        </div>      
    
    <br/>
    
    <p>
    Click <g:link controller="main" action="home">here</g:link> to go back to the home page.
    </p>
    
    <br/>

    
    </div>

    </body>
</html>